Xbasic

A5_SYNCHRONIZE_FOLDERS Function

Syntax

Difference_List as P = a5_synchronize_folders(C folder1 ,C folder2 [,C pattern [,L synchronize_files ]])

Arguments

Difference_List

A dot variable containing lists of the files and folders that have different creation times. List entries are in the format: newer_file|older_file.

folder1

A folder containing files and sub-folders.

folder2

A folder containing files and sub-folders.

pattern

The pattern used to select files. Wildcards are supported.

synchronize_files

Optional. Default = .F. Whether to synchronize the files and folders. .T. = Copy files and folders. .F. = Do not copy files and folders.

Description

Synchronize the files in two folders.

Discussion

The A5_SYNCHRONIZE_FOLDERS() function returns a dot variable containing lists of the files and folders in Folder1 and Folder2 that have different update times.

Example

The following example retrieves a dot variable containing lists of the files and folders in the two folders ( c:\ed1 and c:\ed2 ) whose update times are different. It then copies the newer files and folders to the corresponding folder

dim p as P
p = a5_synchronize_folders("c:\ed1","c:\ed2","*.*", .t.)

See Also